package graphics.handlers;

import graphics.TestingGraphics;
import graphics.object.interfaces.GLTickListener;

import org.lwjgl.opengl.Display;

public class GLFPSHandler implements GLTickListener{
    public long lastFrame;
    public int fps;
    public long lastFPS;
    
    public GLFPSHandler(){
        lastFPS = TestingGraphics.getTime();
        lastFrame = lastFPS;
    }

    public void onTick(long currentTime, long deltaTime) {
        if (currentTime - lastFPS > 1000) {
            Display.setTitle("Test FPS: " + fps);
            fps = 0;
            lastFPS += 1000;
        }
        fps++;
    }
}
